Skip to content

Feed CLI errors into Datadog Error Tracking#87

Merged
alexkroman merged 2 commits into
mainfrom
datadog-error-tracking
Jun 12, 2026
Merged

Feed CLI errors into Datadog Error Tracking#87
alexkroman merged 2 commits into
mainfrom
datadog-error-tracking

Conversation

@alexkroman

Copy link
Copy Markdown
Collaborator

What

Promotes CLI failures into Datadog Error Tracking with zero new PII, and updates the dashboard to match.

aai_cli/telemetry.pybuild_event now, on a failure:

  • sets status: error (successes stay info)
  • adds the reserved error.kind = the anonymous outcome (CLIError.error_type, e.g. api_error, not_authenticated)

status:error + error.kind is exactly Datadog's documented requirement to feed Error Tracking (issue grouping, first-/last-seen, regression detection, alerting). The error message and stack trace are deliberately omitted — no free text leaves the machine — so issues group by error type × command, not by stack.

Why this shape (not inline messages)

Both CLIs this telemetry is modeled on keep their always-on stream message-free:

  • Vercel never sends serialized errors at all.
  • Supabase ships only exit_code via PostHog, and gates full stack traces behind an explicit opt-in --create-ticket → Sentry path.

So shipping only the error type stays within that bar. A message/stack tier remains deferred behind a future opt-in path.

Dashboard

  • Error tiles now filter on the canonical status:error (equivalent to the old -@outcome:success, but Error-Tracking-native).
  • Header note + README document the new status:error / @error.kind fields.
  • New "All errors by frequency (type × command)" table lists every error ranked by occurrence.

Note

Pre-existing failure logs won't be retroactively tagged — Error Tracking populates from new CLI versions onward (or a one-time Datadog log remapper).

Verification

./scripts/check.shAll checks passed. (1728 tests, 100% patch coverage on the diff, mutation gate clean, build + twine OK).

🤖 Generated with Claude Code

alexkroman-assembly and others added 2 commits June 11, 2026 17:15
Failures now ship status:error plus the reserved error.kind attribute
(set to the anonymous error_type — e.g. api_error, not_authenticated),
which is Datadog's documented requirement to promote a log into Error
Tracking (issue grouping, first-/last-seen, regression detection,
alerting). No error message or stack trace rides along, so the privacy
contract is unchanged — issues group by error type x command, not stack.

Successes stay info logs with no error namespace. Both reference CLIs
this telemetry is modeled on keep their always-on stream message-free
(Vercel never sends serialized errors; Supabase ships only exit_code via
PostHog and gates stack traces behind an opt-in --create-ticket path),
so this stays within that bar.

Dashboard: error tiles now filter on the canonical status:error, the
header note documents the new fields, and a new "All errors by frequency
(type x command)" table lists every error ranked by occurrence.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@alexkroman
alexkroman enabled auto-merge (squash) June 12, 2026 00:17
@alexkroman
alexkroman merged commit 41569ef into main Jun 12, 2026
8 checks passed
@alexkroman
alexkroman deleted the datadog-error-tracking branch June 12, 2026 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants